package com.kingschan.jeasytag.core.validation.properties.impl;

import java.lang.reflect.Field;

import org.json.JSONException;
import org.json.JSONObject;

import com.kingschan.jeasytag.core.validation.properties.PropertiesValidation;
import com.kingschan.jeasytag.exception.PropertiesValidationException;

/**
 * JsonFieldValidationImpl
 * @author kingschan
 *date:2013-7-11
 */
public class JsonFieldValidationImpl implements PropertiesValidation{

	@Override
	public void validation(Field f, Object value)throws PropertiesValidationException {
		try {
			@SuppressWarnings("unused")
			JSONObject json = new JSONObject(value.toString());
		} catch (JSONException e) {
			throw new PropertiesValidationException(e.getMessage());
		}
	}

}
